﻿Imports System.Web.Services

Imports BusinessEntities
Imports BusinessLogic
Imports Library


Public Class ActualizarProveedor
    Inherits System.Web.UI.Page

    Dim strUser As String = "SchattenTod"

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            Try
                Me.MostrarProveedor()
                Me.ddlTipoBusqueda.SelectedIndex = -1
                Me.Limpiar()
            Catch ex As Exception
                LogAuditoria.LogInfo(strUser, "ActualizarProveedor-Load", ex.Message)
            End Try
        End If
    End Sub

    Private Sub BuscarProveedor()
        Try
            If ddlTipoBusqueda.SelectedItem.Value.Equals("01") Then
                Me.gvProveedores.DataSource = (New ProveedorBL).ConsultaProveedor(txtBusqueda.Text, "")
            ElseIf ddlTipoBusqueda.SelectedItem.Value.Equals("02") Then
                Me.gvProveedores.DataSource = (New ProveedorBL).ConsultaProveedor("", txtBusqueda.Text)
            Else
                Me.gvProveedores.DataSource = (New ProveedorBL).ConsultaProveedor(0, "")
            End If

            Me.gvProveedores.DataBind()
        Catch ex As Exception
            Throw
        End Try
    End Sub

    Private Sub MostrarProveedor()
        Try

            Me.gvProveedores.DataSource = (New ProveedorBL).ConsultaProveedor("", "")
            Me.gvProveedores.DataBind()
        Catch ex As Exception
            Throw
        End Try
    End Sub

    Private Sub Limpiar()

    End Sub

    Private Sub btnBuscarProveedor_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBuscarProveedor.Click
        BuscarProveedor()
    End Sub
End Class